/*******************************************************************************
  * Copyright(c) 2023 Levetop Semiconductor Co.,Led. All rights reserved.
  * @file     curve.h
  * @author   UartTFT Application Team
  * @version  V0.0.1
  * @date     2023-01-04
  * @brief    This file contains the functions prototypes for the UartTFT
  *           Application display firmware.
 ********************************************************************************/

#ifndef CURVE_H_
#define CURVE_H_

#include "data.h"

/*curve*/
typedef struct
{
	uint16_t xs;
	uint16_t ys;
	uint16_t xe;
	uint16_t ye;
	uint16_t Y_Central;	 // Absolute coordinate of the middle value of the vertical axis
	uint16_t VD_Central; // Intermediate reference value of longitudinal axis
	uint32_t color;		 // Curve color
	uint16_t MUL_Y;		 // Zoom in/out��MUL_Y/256
	uint8_t channel;	 // channel
	uint8_t Dis_HOR;	 // Point spacing
	uint8_t Width;		 // Curve thickness
	uint8_t group;		 // Group number
	uint8_t dir;		 // direction
} Curve_Info;

extern Curve_Info gCurve_Info[CURVE_SIZE];
extern uint16_t Curve_buff[CURVE_SIZE][1024]; // Curve data buffer: 8 channels, 16KB in total
extern uint16_t Curve_count[CURVE_SIZE];		// Curve length
extern uint8_t  curve_update_flag[CURVE_SIZE];		// Curve update flag

extern uint8_t curve_num;		 // Number of curve controls
extern uint8_t curve_flag;		 // Curve timing refresh flag bit
extern uint8_t curve_group_sum; // Total number of groups in curve area

extern void Display_Curve(void);
extern void Real_time_curve_display_dynamic(uint8_t group);
extern void Curve_display(uint8_t type, uint8_t *buff);

#endif /* CURVE_H_ */
